package com.woniu.swagger;/*
 *
 * @author   米雷
 * @Description
 * @Date:create in 19:20 2020-04-03
 *
 * */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2//启用swagger
public class Swagger {
    @Bean
    public Docket apiConfig() {
        return new Docket(DocumentationType.SWAGGER_2)//创建Swagger2类型的文档
                .apiInfo(apiInfo());//apiInfo方法返回配置的接口信息
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("个人中心")//接口标题
                .description("此文档描述了个人中心基本API接口")//接口描述
                .version("1.0")//接口版本
                .contact(new Contact("milei", "http://localhost:8002/", "814689832@qq.com"))//联系方式：名字、网址、邮箱
                .build();
    }
}